package czk.concrent.lockSupport;

import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.LockSupport;

public class Test2 {
    public static void main(String[] args) throws InterruptedException {

        Thread t = new Thread(() -> {
            System.out.println("进入线程1了，等待解锁");
            // 阻塞当前线程
            LockSupport.park();
            System.out.println("解封了");
        });
        t.start();

        System.out.println("哈哈，等我解锁t1吧");
        TimeUnit.SECONDS.sleep(3);
        LockSupport.unpark(t);

    }
}
